import { request } from "@/utils/request";
import type { loginRes, codeRes } from "@/types/login";
// 密码登录
export const loginByPassword = (mobile: string, password: string) =>
  request<loginRes>("/login/password", "POST", {
    mobile,
    password,
  });
// 发送验证码   /code
export const sendCodeApi = (mobile: string, type: string) =>
  request<codeRes>("/code", "GET", { mobile, type });

//   验证码登录 login
export const loginByCode = (mobile: string, code: string) =>
  request<loginRes>("/login", "POST", {
    mobile,
    code,
  });
